import Vue from "vue";
import Router from "vue-router";
// import Login from './views/login/index.vue'
//  下面情况，默认的会导入 ./views/login 目录下的index.vue组件
import Login from './views/login'
import Layout from '@/components/Layout.vue'
import Home from './views/home'
import Dept from './views/dept'
import Person from './views/person'
import Signin from './views/signin'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login', //路由名称
      component: Login //组件对象
    },
    {
      path: '/',
      name: 'layout', //路由名称
      component: Layout, //组件对象
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: Home,
          meta: {title: '首页'}
        },
        // {
        //   path: '/member',
        //   component: Member
        // }
      ]
    },
    {
      path: '/dept',
      component: Layout,
      children: [
        {
          path: '/', 
          component: Dept,
          meta: {title: '部门管理'}
        }
      ]
    },
    {
      path: '/person',
      component: Layout,
      children: [
        {
          path: '/', 
          component: Person,
          meta: {title: '用户管理'}
        }
      ]
    },
    {
      path: '/signin',
      component: Layout,
      children: [
        {
          path: '/', 
          component: Signin,
          meta: {title: '签到管理'}
        }
      ]
    }
  ]
})
